package it.camelotone.webservice;

import it.camelotone.ejb.session.FriendEJB;

import javax.annotation.ManagedBean;
import javax.ejb.EJB;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;

@ManagedBean
@Path("export/{id}")
public class ExportService {
	
    @Context
    private UriInfo context;
    
    @EJB
    private FriendEJB bean;

    /**
     * Default constructor. 
     */
    public ExportService() {
        // TODO Auto-generated constructor stub
    }

    /**
     * Retrieves representation of an instance of ExportService
     * @return an instance of String
     */
    @GET
    @Produces("application/json")
    public String getJson(@PathParam("id") int id) {
        return "{name : '" + bean.findById(id) + "'}";
    }

    /**
     * PUT method for updating or creating an instance of ExportService
     * @param content representation for the resource
     * @return an HTTP response with content of the updated or created resource.
     */
    @PUT
    @Consumes("application/json")
    public void putJson(String content) {
    }

}